package com.ruoyi.yzchu.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yzchu.mapper.YzcAddressMapper;
import com.ruoyi.yzchu.domain.YzcAddress;
import com.ruoyi.yzchu.service.IYzcAddressService;

/**
 * 收货地址管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-06
 */
@Service
public class YzcAddressServiceImpl implements IYzcAddressService 
{
    @Autowired
    private YzcAddressMapper yzcAddressMapper;

    /**
     * 查询收货地址管理
     * 
     * @param addressId 收货地址管理主键
     * @return 收货地址管理
     */
    @Override
    public YzcAddress selectYzcAddressByAddressId(Long addressId)
    {
        return yzcAddressMapper.selectYzcAddressByAddressId(addressId);
    }

    /**
     * 查询收货地址管理列表
     * 
     * @param yzcAddress 收货地址管理
     * @return 收货地址管理
     */
    @Override
    public List<YzcAddress> selectYzcAddressList(YzcAddress yzcAddress)
    {
        return yzcAddressMapper.selectYzcAddressList(yzcAddress);
    }

    /**
     * 新增收货地址管理
     * 
     * @param yzcAddress 收货地址管理
     * @return 结果
     */
    @Override
    public int insertYzcAddress(YzcAddress yzcAddress)
    {
        yzcAddress.setCreateTime(DateUtils.getNowDate());
        return yzcAddressMapper.insertYzcAddress(yzcAddress);
    }

    /**
     * 修改收货地址管理
     * 
     * @param yzcAddress 收货地址管理
     * @return 结果
     */
    @Override
    public int updateYzcAddress(YzcAddress yzcAddress)
    {
        return yzcAddressMapper.updateYzcAddress(yzcAddress);
    }

    /**
     * 批量删除收货地址管理
     * 
     * @param addressIds 需要删除的收货地址管理主键
     * @return 结果
     */
    @Override
    public int deleteYzcAddressByAddressIds(Long[] addressIds)
    {
        return yzcAddressMapper.deleteYzcAddressByAddressIds(addressIds);
    }

    /**
     * 删除收货地址管理信息
     * 
     * @param addressId 收货地址管理主键
     * @return 结果
     */
    @Override
    public int deleteYzcAddressByAddressId(Long addressId)
    {
        return yzcAddressMapper.deleteYzcAddressByAddressId(addressId);
    }
}
